package com.felix.webmagic.Service.impl;import com.felix.webmagic.Service.BlogService;import com.felix.webmagic.pojo.Blog;import com.felix.webmagic.processor.SinaBlogProcessor;import com.felix.webmagic.repository.BlogRepository;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import us.codecraft.webmagic.Spider;import java.util.ArrayList;import java.util.List;@Servicepublic class BlogServiceImpl implements BlogService {    @Autowired    BlogRepository blogRepository;    @Override    public String spiderAndSaveBlogs() {        List<Blog> list = new ArrayList<>();        Spider.create(new SinaBlogProcessor(list))                .addUrl("http://blog.sina.com.cn/s/articlelist_1487828712_0_1.html")                .thread(10)                .run();        blogRepository.save(list);        return null;    }    @Override    public Blog save(Blog blog) {        return blogRepository.save(blog);    }}